﻿<html lang=en>
	<head>
		<meta charset=utf-8>
		<meta http-equiv=X-UA-Compatible content="IE=edge">
		<meta name=viewport content="width=device-width,initial-scale=1">		
		<title></title>		
		<link rel="stylesheet" href="style.css" />
	</head>
	<body>
		<h1>Input API Reference</h1>
		<label>Introduction</label>
		<p>
			This plugin is specialized to simulate user inputs, such as key strokes, mouse clicks, wheel scrolls, etc.
		</p>

		<label>Plugin object:</label>
		<p>
			<code>
				<i class="tab"></i>plugin = _G.plugins.Input <tag>-- get the plugin object</tag>
			</code>
		</p>
		
		<label class="subject">Plugin methods:</label>
		<ul>
			<li><a href="#KeyStoke">plugin.KeyDown</a></li>
			<li><a href="#KeyStoke">plugin.KeyUp</a></li>
			<li><a href="#KeyStoke">plugin.KeyStoke</a></li>
			<li><a href="#SendKeys">plugin.SendKeys</a></li>
			<li><a href="#IsKeyDown">plugin.IsKeyDown</a></li>
			<li><a href="#ReleaseAllKeys">plugin.ReleaseAllKeys</a></li>

			<li><a href="#GetCursorPos">plugin.GetCursorPos</a></li>
			<li><a href="#SetCursorPos">plugin.SetCursorPos</a></li>
			<li><a href="#MouseClick">plugin.MouseDown</a></li>
			<li><a href="#MouseClick">plugin.MouseUp</a></li>
			<li><a href="#MouseClick">plugin.MouseClick</a></li>
			<li><a href="#MouseDrag">plugin.MouseDrag</a></li>
			<li><a href="#MouseWheel">plugin.MouseWheel</a></li>
		</ul>
		<p></p>

		<a name="KeyStoke"></a>
		<label>
			plugin.KeyDown<br />
			plugin.KeyUp<br />
			plugin.KeyStoke<br />
		</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td>
					<code>plugin.KeyDown(key [, mods])</code>
					<code>plugin.KeyUp(key [, mods])</code>
					<code>plugin.KeyStoke(key [, mods])</code>
				</td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>key:</dfn> key name<br />
					<dfn>mods:</dfn> optional modifier key names combined with "|".<br />
				</td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>
					Send keyboard actions
					<code>local plugin = _G.plugins.Input</code>
					<code>plugin.KeyStoke("A") <tag>-- stroke key "A"</tag></code>
					<code>plugin.KeyStoke("F12", "Shift | Alt") <tag>-- stroke combination key "Shift + Alt + F12"</tag></code>
				</td>
			</tr>
		</table>

		<a name="SendKeys"></a>
		<label>plugin.SendKeys</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.SendKeys(text)</code></td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>text:</dfn> text contents to be sent.<br />
				</td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>
					Sends sequence of keys, check C# SendKeys.Send() API for details, here is a good
					<a href="https://www.cnblogs.com/shaozhuyong/p/5951779.html" target="_blank">example</a>.
				</td>
			</tr>
		</table>

		<a name="IsKeyDown"></a>
		<label>plugin.IsKeyDown</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.IsKeyDown(key)</code></td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>key:</dfn> key name<br />
				</td>
			</tr>
			<tr>
				<td>Return values</td>
				<td>
					Returns true if the key is help down, false otherwise.
				</td>
			</tr>
		</table>

		<a name="ReleaseAllKeys"></a>
		<label>plugin.ReleaseAllKeys</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.ReleaseAllKeys()</code></td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>
					Release all keys currently help down.
				</td>
			</tr>
		</table>

		<a name="GetCursorPos"></a>
		<label>plugin.GetCursorPos</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.GetCursorPos()</code></td>
			</tr>
			<tr>
				<td>Return values</td>
				<td>
					Returns (x, y) coordinates of the cursor position.
				</td>
			</tr>

			<tr>
				<td>Samples</td>
				<td>
					<code>local plugin = _G.plugins.Input</code>
					<code>local x, y = plugin.GetCursorPos()</code>
					<code>print(x, y) <tag>-- 106, 893</tag></code>
				</td>
			</tr>
		</table>

		<a name="SetCursorPos"></a>
		<label>plugin.SetCursorPos</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.SetCursorPos(x, y)</code></td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>x, y:</dfn> int coordinates of the position to move the cursor to.<br />
				</td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>Instantly move cursor to the specified location.</td>
			</tr>
		</table>

		<a name="MouseClick"></a>
		<label>
			plugin.MouseDown<br />
			plugin.MouseUp<br />
			plugin.MouseClick<br />
		</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td>
					<code>plugin.MouseDown([button])</code>
					<code>plugin.MouseUp([button])</code>
					<code>plugin.MouseClick([button])</code>
				</td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>button:</dfn> name of the mouse button, "Left, Right, Middle, XButton1, XButton2", default is "Left".<br />
				</td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>Send a mouse action.</td>
			</tr>
		</table>

		<a name="MouseDrag"></a>
		<label>plugin.MouseDrag</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.MouseDrag(x1, y1, x2, y2 [, button])</code></td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>x1, y1:</dfn> int coordinates of the position where drag begins.<br />
					<dfn>x2, y2:</dfn> int coordinates of the position where drag ends.<br />
					<dfn>button:</dfn> name of the mouse button held, default is "Left".<br />
				</td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>Simulates a mouse-drag action.</td>
			</tr>
		</table>

		<a name="MouseWheel"></a>
		<label>plugin.MouseWheel</label>
		<table class="table api-table">
			<tr>
				<td>Function</td>
				<td><code>plugin.MouseWheel([scrollUp])</code></td>
			</tr>
			<tr>
				<td>Arguments</td>
				<td>
					<dfn>scrollUp:</dfn> bool value whether to scroll up, default is false.<br />
				</td>
			</tr>
			<tr>
				<td>Remarks</td>
				<td>Sends a mouse wheel scroll action.</td>
			</tr>
		</table>
	</body>
</html>